package com.edu.DAO;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import java.sql.*;
import com.edu.Utils.DataSourceUtils;
import com.edu.model.Shoes;
public class ShoesDAO {
	QueryRunner qr = new QueryRunner(DataSourceUtils.getDataSource());
	//查询商品详情
    public Shoes getshoesbyid(String id) {
    	Shoes sh=null;
    	String sql ="select * from goods where id=? and flag=1";
    	try {
			sh = qr.query(sql,new BeanHandler<>(Shoes.class),id);
		} catch (SQLException e) {
			e.printStackTrace();
		}
    	return sh;
    }
}
